package version1;
import condorAPI.*;

public class submitJob{

  public static void main(String [] args) 
  throws CondorException{
    // create a Condor object
    Condor condor = new Condor();
    condor.status();

    // create a JobDescription object using existing file 
    // 'test.submit'
    //JobDescription jd = new JobDescription("submit");
    //"~/condor/jobs/java/submit"
    
    /*	Universe	= Java
		Executable	= Job.class
		#Requirements	= TARGET.OpSys=="LINUX"
		Log		= log
		Error		= error/$(Process)
		Output		= output/$(Process)
		Arguments	= Job 5 7
		Queue		1
     */
    String [] submitArgs = {"Universe", "Java", 
    				  "Log", "log", 
    				  "Output", "output/$(Process)",
    				  "Arguments", "Job 5 7",
    				  "Queue", "1"
    };
    String executable = "Job.class";

    // submit the jobDescription and get Cluster
    //Cluster c = condor.submit(jd);
    Cluster c = condor.submitJob(executable, submitArgs);
    //Cluster c = condor.submitJob("submit");
    System.out.println("submitted " + c);
    
    condor.statusQ();
    
    // wait for done
    c.waitFor();
    // print out cluster status
    System.out.println(c.dump());
  }
}